<template>
    <n-spin size="large" :show="loading">
        <n-form ref="formRef" label-placement="left" label-width="150px">
            <n-tabs type="line" animated v-if="init">
                <n-tab-pane name="sys" tab="系统配置">
                    <!-- <n-form-item label="接口服务">
                        <n-space :align="'center'">
                            <n-switch :loading="loading" v-model:value="model['SYS_SERVICE_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SYS_SERVICE_BOOL',val)}">
                                <template #checked>开启</template>
                                <template #unchecked>关闭</template>
                            </n-switch>

                            <div>服务端是否提供服务</div>
                        </n-space>
                    </n-form-item> -->
                    <n-form-item label="门店锁定">
                        <n-space vertical :size="24">
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SYS_SHARE_MCH_LOCK_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SYS_SHARE_MCH_LOCK_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>
                                <div>是否对用户通过订单/车辆/门店分享进入小程序，进行门店锁定</div>
                            </n-space>
                            <n-space :align="'center'" v-if="model['SYS_SHARE_MCH_LOCK_BOOL']">
                                <div>分享有效天数：</div>
                                <n-input-group>
                                    <DecimalInput
                                        :border="true"
                                        :precision="0"
                                        :width="60"
                                        suffix="天"
                                        :min="0"
                                        v-model:base="model['SYS_SHARE_MCH_LOCK_DAYS_INT']"
                                        @update:base="
                                            () => {
                                                uis['SYS_SHARE_MCH_LOCK_DAYS_INT'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SYS_SHARE_MCH_LOCK_DAYS_INT']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SYS_SHARE_MCH_LOCK_DAYS_INT', model['SYS_SHARE_MCH_LOCK_DAYS_INT'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>

                                <div>内，未在分享门店成功下单，则取消锁定状态</div>
                            </n-space>
                        </n-space>
                    </n-form-item>
                </n-tab-pane>
                <n-tab-pane name="fin" tab="财务配置">
                    <n-form-item label="自动转账阈值">
                        <n-space :align="'center'">
                            <n-input-group>
                                <DecimalInput
                                    :border="true"
                                    :precision="2"
                                    :width="150"
                                    suffix="元"
                                    :min="0"
                                    v-model:base="model['FIN_WITHDRAW_AUTO_TRAN_LIMIT_INT']"
                                    @update:base="
                                        () => {
                                            uis['FIN_WITHDRAW_AUTO_TRAN_LIMIT_INT'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['FIN_WITHDRAW_AUTO_TRAN_LIMIT_INT']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('FIN_WITHDRAW_AUTO_TRAN_LIMIT_INT', model['FIN_WITHDRAW_AUTO_TRAN_LIMIT_INT'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>

                            <div>*提现金额小于此金额的将自动进行转账操作，设置为0元不启用自动转账</div>
                        </n-space>
                    </n-form-item>
                </n-tab-pane>
                <n-tab-pane name="web" tab="页面配置">
                    <n-form-item label="用户协议">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_YHXY_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_YHXY_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_YHXY_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_YHXY_STR', model['WEB_PAGE_YHXY_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="隐私政策">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_YSZC_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_YSZC_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_YSZC_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_YSZC_STR', model['WEB_PAGE_YSZC_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="门店入驻指引">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_RZZY_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_RZZY_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_RZZY_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_RZZY_STR', model['WEB_PAGE_RZZY_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="门店入驻协议">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_RZXY_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_RZXY_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_RZXY_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_RZXY_STR', model['WEB_PAGE_RZXY_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>

                    <n-form-item label="经营授权书">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_JYSQ_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_JYSQ_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_JYSQ_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_JYSQ_STR', model['WEB_PAGE_JYSQ_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="客服中心">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_KFZX_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_KFZX_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_KFZX_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_KFZX_STR', model['WEB_PAGE_KFZX_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="租车须知">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_ZCXZ_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_ZCXZ_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_ZCXZ_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_ZCXZ_STR', model['WEB_PAGE_ZCXZ_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="平台须知">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_PTXZ_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_PTXZ_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_PTXZ_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_PTXZ_STR', model['WEB_PAGE_PTXZ_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="预订须知">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_YDXZ_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_YDXZ_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_YDXZ_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_YDXZ_STR', model['WEB_PAGE_YDXZ_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="预订条款">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_YDTK_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_YDTK_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_YDTK_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_YDTK_STR', model['WEB_PAGE_YDTK_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="门店政策">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_MDZC_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_MDZC_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_MDZC_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_MDZC_STR', model['WEB_PAGE_MDZC_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="关于我们">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    placeholder="请填写页面访问地址"
                                    :style="{ maxWidth: '500px', minWidth: '500px' }"
                                    v-model:value="model['WEB_PAGE_GYWM_STR']"
                                    @update:value="
                                        () => {
                                            uis['WEB_PAGE_GYWM_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['WEB_PAGE_GYWM_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('WEB_PAGE_GYWM_STR', model['WEB_PAGE_GYWM_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>页面访问地址，例：https://www.demo.com/page.html</div>
                        </n-space>
                    </n-form-item>
                </n-tab-pane>
                <n-tab-pane name="sms" tab="短信配置">
                    <n-form-item label="手机验证码">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_MOB_CAPTCHA_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_MOB_CAPTCHA_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_MOB_CAPTCHA_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_MOB_CAPTCHA_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_MOB_CAPTCHA_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_MOB_CAPTCHA_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_MOB_CAPTCHA_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_MOB_CAPTCHA_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_MOB_CAPTCHA_TMPL_ID_STR'] || uis['SMS_MOB_CAPTCHA_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_MOB_CAPTCHA_TMPL_ID_STR', model['SMS_MOB_CAPTCHA_TMPL_ID_STR'])
                                                execSaveConfig('SMS_MOB_CAPTCHA_TMPL_INFO_STR', model['SMS_MOB_CAPTCHA_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_MOB_CAPTCHA] 用于获取手机验证码，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${code}</n-tag>
                                验证码
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="门店入驻审核通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_MCH_AUDIT_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_MCH_AUDIT_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_MCH_AUDIT_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_MCH_AUDIT_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_MCH_AUDIT_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_MCH_AUDIT_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_MCH_AUDIT_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_MCH_AUDIT_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_MCH_AUDIT_TMPL_ID_STR'] || uis['SMS_MCH_AUDIT_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_MCH_AUDIT_TMPL_ID_STR', model['SMS_MCH_AUDIT_TMPL_ID_STR'])
                                                execSaveConfig('SMS_MCH_AUDIT_TMPL_INFO_STR', model['SMS_MCH_AUDIT_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_MCH_AUDIT] 用于发送门店审核结果通知，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${mid}</n-tag>
                                门店编号，
                                <n-tag size="small" :bordered="false" type="warning">${state}</n-tag>
                                审核结果
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="订单预订提醒">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_ORDER_BOOK_TO_MER_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_BOOK_TO_MER_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_BOOK_TO_MER_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_BOOK_TO_MER_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_BOOK_TO_MER_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_BOOK_TO_MER_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_BOOK_TO_MER_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_BOOK_TO_MER_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_BOOK_TO_MER_TMPL_ID_STR'] || uis['SMS_ORDER_BOOK_TO_MER_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_BOOK_TO_MER_TMPL_ID_STR', model['SMS_ORDER_BOOK_TO_MER_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_BOOK_TO_MER_TMPL_INFO_STR', model['SMS_ORDER_BOOK_TO_MER_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_BOOK_TO_MER] 用于客户预订成功，通知门店确认订单，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${car}</n-tag>
                                车辆信息，
                                <n-tag size="small" :bordered="false" type="warning">${cno}</n-tag>
                                车牌号码
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="订单续租提醒">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_ORDER_RELET_TO_MER_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_RELET_TO_MER_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_RELET_TO_MER_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_RELET_TO_MER_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_RELET_TO_MER_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_RELET_TO_MER_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_RELET_TO_MER_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_RELET_TO_MER_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_RELET_TO_MER_TMPL_ID_STR'] || uis['SMS_ORDER_RELET_TO_MER_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_RELET_TO_MER_TMPL_ID_STR', model['SMS_ORDER_RELET_TO_MER_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_RELET_TO_MER_TMPL_INFO_STR', model['SMS_ORDER_RELET_TO_MER_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_RELET_TO_MER] 用于客户续租订单成功，通知门店，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${car}</n-tag>
                                车辆信息，
                                <n-tag size="small" :bordered="false" type="warning">${cno}</n-tag>
                                车牌号码，
                                <n-tag size="small" :bordered="false" type="warning">${time}</n-tag>
                                续租还车时间
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="违章通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" disabled v-model:value="model['SMS_ORDER_VIOLATE_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_VIOLATE_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_VIOLATE_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_VIOLATE_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_VIOLATE_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_VIOLATE_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_VIOLATE_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_VIOLATE_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_VIOLATE_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_VIOLATE_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_VIOLATE_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_VIOLATE_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_VIOLATE_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_VIOLATE_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_VIOLATE_TO_CUST] 用于订单还车后，读取到违章信息，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${count}</n-tag>
                                违章次数
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="支付提醒">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_ORDER_PAY_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_PAY_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_PAY_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_PAY_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_PAY_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_PAY_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_PAY_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_PAY_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_PAY_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_PAY_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_PAY_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_PAY_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_PAY_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_PAY_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_PAY_TO_CUST] 用于发送订单未支付提醒，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="支付成功通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_ORDER_PAID_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_PAID_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_PAID_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_PAID_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_PAID_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_PAID_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_PAID_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_PAID_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_PAID_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_PAID_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_PAID_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_PAID_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_PAID_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_PAID_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_PAID_TO_CUST] 用于发送订单支付成功提醒，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号，
                                <n-tag size="small" :bordered="false" type="warning">${time}</n-tag>
                                取车时间，
                                <n-tag size="small" :bordered="false" type="warning">${addr}</n-tag>
                                取车地址，
                                <n-tag size="small" :bordered="false" type="warning">${tel}</n-tag>
                                门店电话
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="订单取消通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_ORDER_CANCEL_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_CANCEL_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_CANCEL_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_CANCEL_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_CANCEL_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_CANCEL_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_CANCEL_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_CANCEL_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_CANCEL_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_CANCEL_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_CANCEL_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_CANCEL_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_CANCEL_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_CANCEL_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_CANCEL_TO_CUST] 用于发送订单长时间未支付平台自动取消提醒，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="取车提醒">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" disabled v-model:value="model['SMS_ORDER_RECEIVE_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_RECEIVE_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_RECEIVE_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_RECEIVE_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_RECEIVE_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_RECEIVE_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_RECEIVE_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_RECEIVE_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_RECEIVE_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_RECEIVE_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_RECEIVE_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_RECEIVE_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_RECEIVE_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_RECEIVE_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_RECEIVE_TO_CUST] 用于发送订单临近取车时间提醒，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${name}</n-tag>
                                客户名称，
                                <n-tag size="small" :bordered="false" type="warning">${time}</n-tag>
                                取车时间，
                                <n-tag size="small" :bordered="false" type="warning">${addr}</n-tag>
                                取车地址，
                                <n-tag size="small" :bordered="false" type="warning">${tel}</n-tag>
                                门店电话，
                                <n-tag size="small" :bordered="false" type="warning">${car}</n-tag>
                                车辆名称
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="签约提醒">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" disabled v-model:value="model['SMS_ORDER_SIGN_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_SIGN_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_SIGN_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_SIGN_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_SIGN_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_SIGN_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_SIGN_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_SIGN_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_SIGN_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_SIGN_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_SIGN_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_SIGN_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_SIGN_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_SIGN_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_SIGN_TO_CUST] 用于发送订单签约提醒，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${name}</n-tag>
                                客户名称，
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号，
                                <n-tag size="small" :bordered="false" type="warning">${url}</n-tag>
                                签约地址
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="交车成功通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_ORDER_START_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_START_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_START_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_START_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_START_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_START_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_START_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_START_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_START_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_START_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_START_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_START_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_START_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_START_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_START_TO_CUST] 用于发送订单交车成功通知，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号，
                                <n-tag size="small" :bordered="false" type="warning">${cno}</n-tag>
                                车牌号，
                                <n-tag size="small" :bordered="false" type="warning">${begin}</n-tag>
                                开始时间，
                                <n-tag size="small" :bordered="false" type="warning">${close}</n-tag>
                                结束时间
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="还车提醒">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" disabled v-model:value="model['SMS_ORDER_RESTORE_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_RESTORE_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_RESTORE_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_RESTORE_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_RESTORE_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_RESTORE_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_RESTORE_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_RESTORE_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_RESTORE_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_RESTORE_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_RESTORE_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_RESTORE_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_RESTORE_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_RESTORE_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_RESTORE_TO_CUST] 用于发送订单即将还车提醒，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号，
                                <n-tag size="small" :bordered="false" type="warning">${time}</n-tag>
                                还车时间，
                                <n-tag size="small" :bordered="false" type="warning">${addr}</n-tag>
                                还车地址
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="还车成功通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_ORDER_FINISH_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_FINISH_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_FINISH_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_FINISH_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_FINISH_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_FINISH_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_FINISH_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_FINISH_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_FINISH_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_FINISH_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_FINISH_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_FINISH_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_FINISH_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_FINISH_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_FINISH_TO_CUST] 用于发送订单还车成功通知，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号，
                                <n-tag size="small" :bordered="false" type="warning">${cda}</n-tag>
                                车辆押金金额，
                                <n-tag size="small" :bordered="false" type="warning">${ida}</n-tag>
                                违章押金金额，
                                <n-tag size="small" :bordered="false" type="warning">${fda}</n-tag>
                                已解冻金额，
                                <n-tag size="small" :bordered="false" type="warning">${type}</n-tag>
                                押金类型，
                                <n-tag size="small" :bordered="false" type="warning">${day}</n-tag>
                                违章查询天数，
                                <n-tag size="small" :bordered="false" type="warning">${date}</n-tag>
                                预计违章押金解冻日期
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="订单退款通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" disabled v-model:value="model['SMS_ORDER_REFUND_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_REFUND_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_REFUND_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_REFUND_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_REFUND_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_REFUND_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_REFUND_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_REFUND_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_REFUND_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_REFUND_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_REFUND_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_REFUND_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_REFUND_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_REFUND_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_REFUND_TO_CUST] 用于发送订单退款通知，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号，
                                <n-tag size="small" :bordered="false" type="warning">${ramt}</n-tag>
                                退款金额
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="订单违章通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch
                                    :loading="loading"
                                    disabled
                                    v-model:value="model['SMS_ORDER_VIOLATE_RUND_TO_CUST_BOOL']"
                                    @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_VIOLATE_RUND_TO_CUST_BOOL',val)}"
                                >
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_VIOLATE_RUND_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_VIOLATE_RUND_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_VIOLATE_RUND_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_VIOLATE_RUND_TO_CUST] 用于发送订单进行中读取到违章信息，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="扣款成功通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" disabled v-model:value="model['SMS_ORDER_FINE_SUCC_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_FINE_SUCC_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_FINE_SUCC_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_FINE_SUCC_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_FINE_SUCC_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_FINE_SUCC_TO_CUST] 用于发送订单预授权扣款成功通知，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号，
                                <n-tag size="small" :bordered="false" type="warning">${amt}</n-tag>
                                扣款金额
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="扣款失败通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" disabled v-model:value="model['SMS_ORDER_FINE_ERR_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_FINE_ERR_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_FINE_ERR_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_FINE_ERR_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_FINE_ERR_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_FINE_ERR_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_FINE_ERR_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_FINE_ERR_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_FINE_ERR_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_FINE_ERR_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_FINE_ERR_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_FINE_ERR_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_FINE_ERR_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_FINE_ERR_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>
                            <div>
                                [SMS_ORDER_FINE_ERR_TO_CUST] 用于发送订单预授权扣款失败通知，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号，
                                <n-tag size="small" :bordered="false" type="warning">${amt}</n-tag>
                                扣款金额，
                                <n-tag size="small" :bordered="false" type="warning">${cause}</n-tag>
                                失败原因
                            </div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="订单完成通知">
                        <n-space vertical>
                            <n-space :align="'center'">
                                <n-switch :loading="loading" v-model:value="model['SMS_ORDER_END_TO_CUST_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('SMS_ORDER_END_TO_CUST_BOOL',val)}">
                                    <template #checked>开启</template>
                                    <template #unchecked>关闭</template>
                                </n-switch>

                                <n-input-group>
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_END_TO_CUST_BOOL']"
                                        placeholder="请填写模板ID"
                                        :style="{ width: '200px' }"
                                        v-model:value="model['SMS_ORDER_END_TO_CUST_TMPL_ID_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_END_TO_CUST_TMPL_ID_STR'] = true
                                            }
                                        "
                                    />
                                    <n-input
                                        :loading="loading"
                                        :readonly="!model['SMS_ORDER_END_TO_CUST_BOOL']"
                                        placeholder="请填写模板内容"
                                        :style="{ width: '500px' }"
                                        v-model:value="model['SMS_ORDER_END_TO_CUST_TMPL_INFO_STR']"
                                        @update:value="
                                            () => {
                                                uis['SMS_ORDER_END_TO_CUST_TMPL_INFO_STR'] = true
                                            }
                                        "
                                    />
                                    <n-button
                                        v-if="uis['SMS_ORDER_END_TO_CUST_TMPL_ID_STR'] || uis['SMS_ORDER_END_TO_CUST_TMPL_INFO_STR']"
                                        type="primary"
                                        ghost
                                        @click="
                                            () => {
                                                execSaveConfig('SMS_ORDER_END_TO_CUST_TMPL_ID_STR', model['SMS_ORDER_END_TO_CUST_TMPL_ID_STR'])
                                                execSaveConfig('SMS_ORDER_END_TO_CUST_TMPL_INFO_STR', model['SMS_ORDER_END_TO_CUST_TMPL_INFO_STR'])
                                            }
                                        "
                                    >
                                        确认
                                    </n-button>
                                </n-input-group>
                            </n-space>

                            <div>
                                [SMS_ORDER_END_TO_CUST] 用于发送订单完成，所有押金已退通知，通知客户，可选参数：
                                <n-tag size="small" :bordered="false" type="warning">${oid}</n-tag>
                                订单编号，
                                <n-tag size="small" :bordered="false" type="warning">${amt}</n-tag>
                                违章押金
                            </div>
                        </n-space>
                    </n-form-item>
                </n-tab-pane>
                <n-tab-pane name="log" tab="日志配置">
                    <n-form-item label="登录日志">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input-number
                                    :loading="loading"
                                    :min="0"
                                    :max="365000"
                                    :style="{ maxWidth: '100px' }"
                                    placeholder="请填写保存天数"
                                    :show-button="false"
                                    v-model:value="model['LOG_LOGIN_EXPIRE_DAYS_INT']"
                                    @update:value="
                                        () => {
                                            uis['LOG_LOGIN_EXPIRE_DAYS_INT'] = true
                                        }
                                    "
                                >
                                    <template #suffix>天</template>
                                </n-input-number>
                                <n-button
                                    v-if="uis['LOG_LOGIN_EXPIRE_DAYS_INT']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('LOG_LOGIN_EXPIRE_DAYS_INT', model['LOG_LOGIN_EXPIRE_DAYS_INT'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>系统用户登录日志保存时长，建议30~180天，保存时长越久占用数据空间越大</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="操作日志">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input-number
                                    :loading="loading"
                                    :min="0"
                                    :max="365000"
                                    :style="{ maxWidth: '100px' }"
                                    placeholder="请填写保存天数"
                                    :show-button="false"
                                    v-model:value="model['LOG_ACTION_EXPIRE_DAYS_INT']"
                                    @update:value="
                                        () => {
                                            uis['LOG_ACTION_EXPIRE_DAYS_INT'] = true
                                        }
                                    "
                                >
                                    <template #suffix>天</template>
                                </n-input-number>
                                <n-button
                                    v-if="uis['LOG_ACTION_EXPIRE_DAYS_INT']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('LOG_ACTION_EXPIRE_DAYS_INT', model['LOG_ACTION_EXPIRE_DAYS_INT'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>系统用户重要业务操作日志保存时长，建议30~180天，保存时长越久占用数据空间越大</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="接口日志">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input-number
                                    :loading="loading"
                                    :min="0"
                                    :max="365000"
                                    :style="{ maxWidth: '100px' }"
                                    placeholder="请填写保存天数"
                                    :show-button="false"
                                    v-model:value="model['LOG_EXTAPI_EXPIRE_DAYS_INT']"
                                    @update:value="
                                        () => {
                                            uis['LOG_EXTAPI_EXPIRE_DAYS_INT'] = true
                                        }
                                    "
                                >
                                    <template #suffix>天</template>
                                </n-input-number>
                                <n-button
                                    v-if="uis['LOG_EXTAPI_EXPIRE_DAYS_INT']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('LOG_EXTAPI_EXPIRE_DAYS_INT', model['LOG_EXTAPI_EXPIRE_DAYS_INT'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>第三方接口调用日志，建议15~30天，保存时长越久占用数据空间越大</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="短信日志">
                        <n-space :align="'center'">
                            <n-input-group>
                                <n-input-number
                                    :loading="loading"
                                    :min="0"
                                    :max="365000"
                                    :style="{ maxWidth: '100px' }"
                                    placeholder="请填写保存天数"
                                    :show-button="false"
                                    v-model:value="model['LOG_SMS_SENDER_EXPIRE_DAYS_INT']"
                                    @update:value="
                                        () => {
                                            uis['LOG_SMS_SENDER_EXPIRE_DAYS_INT'] = true
                                        }
                                    "
                                >
                                    <template #suffix>天</template>
                                </n-input-number>
                                <n-button
                                    v-if="uis['LOG_SMS_SENDER_EXPIRE_DAYS_INT']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('LOG_SMS_SENDER_EXPIRE_DAYS_INT', model['LOG_SMS_SENDER_EXPIRE_DAYS_INT'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>系统发送短信日志保存时长，建议30~180天，保存时长越久占用数据空间越大</div>
                        </n-space>
                    </n-form-item>
                </n-tab-pane>
                <n-tab-pane name="csvc" tab="客服配置">
                    <n-form-item label="客服电话">
                        <n-space :align="'center'">
                            <n-switch :loading="loading" v-model:value="model['CSVC_HTEL_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('CSVC_HTEL_BOOL',val)}">
                                <template #checked>开启</template>
                                <template #unchecked>关闭</template>
                            </n-switch>

                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    :readonly="!model['CSVC_HTEL_BOOL']"
                                    placeholder="请填写电话号码"
                                    :style="{ maxWidth: '200px' }"
                                    v-model:value="model['CSVC_HTEL_STR']"
                                    @update:value="
                                        () => {
                                            uis['CSVC_HTEL_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['CSVC_HTEL_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('CSVC_HTEL_STR', model['CSVC_HTEL_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>请填写平台客服电话</div>
                        </n-space>
                    </n-form-item>
                    <n-form-item label="投诉电话">
                        <n-space :align="'center'">
                            <n-switch :loading="loading" v-model:value="model['CSVC_CTEL_BOOL']" @update:value="(val: boolean) =>{ execSaveConfig('CSVC_CTEL_BOOL',val)}">
                                <template #checked>开启</template>
                                <template #unchecked>关闭</template>
                            </n-switch>

                            <n-input-group>
                                <n-input
                                    :loading="loading"
                                    :readonly="!model['CSVC_CTEL_BOOL']"
                                    placeholder="请填写电话号码"
                                    :style="{ maxWidth: '200px' }"
                                    v-model:value="model['CSVC_CTEL_STR']"
                                    @update:value="
                                        () => {
                                            uis['CSVC_CTEL_STR'] = true
                                        }
                                    "
                                />
                                <n-button
                                    v-if="uis['CSVC_CTEL_STR']"
                                    type="primary"
                                    ghost
                                    @click="
                                        () => {
                                            execSaveConfig('CSVC_CTEL_STR', model['CSVC_CTEL_STR'])
                                        }
                                    "
                                >
                                    确认
                                </n-button>
                            </n-input-group>
                            <div>请填写平台投诉电话</div>
                        </n-space>
                    </n-form-item>
                </n-tab-pane>
            </n-tabs>
        </n-form>
    </n-spin>
</template>

<script lang="ts" setup>
import { Http } from '@/libs'
import { useStore } from '@/store'
import { computed, onActivated, ref } from 'vue'
import DecimalInput from '@/comp/func/DecimalInput.vue'

const store = useStore()
const { $message: message } = window
const loading = computed(() => store.state.loading.flag)

const init = ref<boolean>(false)

const formRef = ref<any>(null)

const model = ref<any>({})

const uis = ref<any>({})

const execSaveConfig = (key: string, val: any) => {
    Http.post('/ops/sys/conf/save', {
        key: key,
        val: String(val),
    }).then(resp => {
        if (resp.stat.err > 0) {
            return
        }
        uis.value[key] = false
        message.success('保存配置成功')
    })
}

const execLoadConfigs = () => {
    init.value = false
    Http.post('/ops/sys/conf/list', {}).then(resp => {
        if (resp.stat.err > 0) {
            return
        }
        let confs: any = {}
        resp.data.items.forEach((item: any) => {
            if (item.key.endsWith('_BOOL')) {
                confs[item.key] = item.val
            } else if (item.key.endsWith('_INT')) {
                confs[item.key] = parseInt(item.val)
            } else if (item.key.endsWith('_FLOAT')) {
                confs[item.key] = parseFloat(item.val)
            } else {
                confs[item.key] = item.val
            }
        })
        model.value = confs
        init.value = true
    })
}

onActivated(() => {
    execLoadConfigs()
})
</script>
